sprintf-related integer and memory overflow issues.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 29 Aug 2011 15:43:34 +0000 (08:43 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 29 Aug 2011 15:43:34 +0000 (08:43 -0700)
commit99918f05178577a9b61a5cef810361629457e652
treeeb317bf316dac36aa49569759db2c75c5ca3b7ef
parent0d70eb653d4f3b7ef2d2a802d4e47e58dca59c13
sprintf-related integer and memory overflow issues.

* doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
(esprintf, esnprintf, exprintf, evxprintf): New functions.
* keyboard.c (command_loop_level): Now EMACS_INT, not int.
(cmd_error): kbd macro iterations count is now EMACS_INT, not int.
(modify_event_symbol): Do not assume that the length of
name_alist_or_stem is safe to alloca and fits in int.
(Fexecute_extended_command): Likewise for function name and binding.
(Frecursion_depth): Wrap around reliably on integer overflow.
* keymap.c (push_key_description): First arg is now EMACS_INT, not int,
since some callers pass EMACS_INT values.
(Fsingle_key_description): Don't crash if symbol name contains more
than MAX_ALLOCA bytes.
* minibuf.c (minibuf_level): Now EMACS_INT, not int.
(get_minibuffer): Arg is now EMACS_INT, not int.
* lisp.h (get_minibuffer, push_key_description): Reflect API changes.
(esprintf, esnprintf, exprintf, evxprintf): New decls.
* window.h (command_loop_level, minibuf_level): Reflect API changes.
src/ChangeLog
src/doprnt.c
src/keyboard.c
src/keymap.c
src/lisp.h
src/minibuf.c
src/window.h